package com.guigu.service.impl;
import com.guigu.entity.PhysiqueEvaluation;
import com.guigu.entity.Ressksisys;
import com.guigu.mapper.RiskassessmentMapper;
import com.guigu.service.RiskassessmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class RiskassessmentServiceImpl implements RiskassessmentService {
    @Autowired
    private RiskassessmentMapper mapper;

    /**
     * 根据id删除的实现类方法
     * @param id
     * @return
     */
    @Override
    public int deleteById(int id) {
        return this.mapper.deleteById(id);
    }

    /**
     * 添加的实现类方法
     * @param pe
     * @return
     */
    @Override
    public int add(Ressksisys pe) {
        this.mapper.addClassify(this.mapper.queryByFileNumber(pe.getFileNumber()));
        return this.mapper.add(pe);
    }

    /**
     * 查询的实现类方法
     * @param pe
     * @return
     */
    @Override
    public List<Ressksisys> queryPhysiqueEvaluation(Ressksisys pe) {
        return this.mapper.queryPhysiqueEvaluation(pe);
    }

    /**
     * 根据id查询的实现类方法
     * @param id
     * @return
     */
    @Override
    public PhysiqueEvaluation queryById(int id) {
        return this.mapper.queryById(id);
    }
}
